<?php

namespace Gairal\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

/**
 * Education
 *
 * @ORM\Table(name="gairal_education")
 * @ORM\Entity(repositoryClass="Gairal\CoreBundle\Entity\EducationRepository")
 * @UniqueEntity(fields="name", message="This education already exists in the database.")
 */
class Education
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=100)
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="short_description", type="string", length=255, nullable=true)
     */
    private $shortDescription;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="year_in", type="date")
     */
    private $yearIn;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="year_out", type="date", nullable=true)
     */
    private $yearOut;

    /**
     * @var string
     *
     * @ORM\Column(name="place", type="string", length=50)
     */
    private $place;

    /**
     * @var string
     *
     * @ORM\Column(name="diploma", type="string", length=255)
     */
    private $diploma;

    /**
     * @var string
     *
     * @ORM\Column(name="website", type="string", length=255)
     */
    private $website;

    /**
     * @var string
     *
     * @ORM\Column(name="extra_info", type="text", nullable=true)
     */
    private $extraInfo;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="text", nullable=true)
     */
    private $description;

    /**
     * @var string
     *
     * @ORM\ManyToOne(targetEntity="Gairal\CoreBundle\Entity\Image")
     * @ORM\JoinColumn(nullable=true)
     * @Assert\Valid()
     */
    private $image;

    /**
     * @var string
     *
     * @ORM\ManyToMany(targetEntity="Gairal\CoreBundle\Entity\Skill", inversedBy="educations")
     * @ORM\JoinColumn(nullable=true)
     */
    private $skills;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     * @return Education
     */
    public function setName($name)
    {
        $this->name = $name;
    
        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set shortDescription
     *
     * @param string $shortDescription
     * @return Education
     */
    public function setShortDescription($shortDescription)
    {
        $this->shortDescription = $shortDescription;
    
        return $this;
    }

    /**
     * Get shortDescription
     *
     * @return string 
     */
    public function getShortDescription()
    {
        return $this->shortDescription;
    }

    /**
     * Set yearIn
     *
     * @param \DateTime $yearIn
     * @return Education
     */
    public function setYearIn($yearIn)
    {
        $this->yearIn = $yearIn;
    
        return $this;
    }

    /**
     * Get yearIn
     *
     * @return \DateTime 
     */
    public function getYearIn()
    {
        return $this->yearIn;
    }

    /**
     * Set yearOut
     *
     * @param \DateTime $yearOut
     * @return Education
     */
    public function setYearOut($yearOut)
    {
        $this->yearOut = $yearOut;
    
        return $this;
    }

    /**
     * Get yearOut
     *
     * @return \DateTime 
     */
    public function getYearOut()
    {
        return $this->yearOut;
    }

    /**
     * Set place
     *
     * @param string $place
     * @return Education
     */
    public function setPlace($place)
    {
        $this->place = $place;
    
        return $this;
    }

    /**
     * Get place
     *
     * @return string 
     */
    public function getPlace()
    {
        return $this->place;
    }

    /**
     * Set diploma
     *
     * @param string $diploma
     * @return Education
     */
    public function setDiploma($diploma)
    {
        $this->diploma = $diploma;
    
        return $this;
    }

    /**
     * Get diploma
     *
     * @return string 
     */
    public function getDiploma()
    {
        return $this->diploma;
    }

    /**
     * Set website
     *
     * @param string $website
     * @return Education
     */
    public function setWebsite($website)
    {
        $this->website = $website;
    
        return $this;
    }

    /**
     * Get website
     *
     * @return string 
     */
    public function getWebsite()
    {
        return $this->website;
    }

    /**
     * Set extraInfo
     *
     * @param string $extraInfo
     * @return Education
     */
    public function setExtraInfo($extraInfo)
    {
        $this->extraInfo = $extraInfo;
    
        return $this;
    }

    /**
     * Get extraInfo
     *
     * @return string 
     */
    public function getExtraInfo()
    {
        return $this->extraInfo;
    }

    /**
     * Set description
     *
     * @param string $description
     * @return Education
     */
    public function setDescription($description)
    {
        $this->description = $description;
    
        return $this;
    }

    /**
     * Get description
     *
     * @return string 
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Set image
     *
     * @param \Gairal\CoreBundle\Entity\Image $image
     * @return Education
     */
    public function setImage(\Gairal\CoreBundle\Entity\Image $image = null)
    {
        $this->image = $image;
    
        return $this;
    }

    /**
     * Get image
     *
     * @return \Gairal\CoreBundle\Entity\Image 
     */
    public function getImage()
    {
        return $this->image;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->skills = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add skills
     *
     * @param \Gairal\CoreBundle\Entity\Skill $skills
     * @return Education
     */
    public function addSkill(\Gairal\CoreBundle\Entity\Skill $skills)
    {
        $this->skills[] = $skills;
    
        return $this;
    }

    /**
     * Remove skills
     *
     * @param \Gairal\CoreBundle\Entity\Skill $skills
     */
    public function removeSkill(\Gairal\CoreBundle\Entity\Skill $skills)
    {
        $this->skills->removeElement($skills);
    }

    /**
     * Get skills
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getSkills()
    {
        return $this->skills;
    }
}